Skip to content

chore(deps): update dependency minimatch to v11.0.10 [security] - #4424

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-minimatch-vulnerability
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-minimatch-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
minimatch 11.0.8 → 11.0.10 age confidence

minimatch: Proto Key Bypasses Cache-Key Weighting in minimatch's Shared Matcher Cache

CVE-2026-141514 / GHSA-3924-r96c-gp9w

More information

Details

Summary

minimatch's module-global matcher cache can be poisoned by a __proto__ key in the options object passed to minimatch(). optionsKey() scores that key the same as no options at all, while copyOptions()'s bare for...in loop re-parents its copy onto the attacker's prototype instead of copying it as an own property — one caller doing this is enough to flip the cached matcher's case-sensitivity for every later, unrelated caller matching the same pattern string.

Details

src/index.ts:229-234, optionsKey() has no case '__proto__', so it falls through to default and contributes weight 0:

const optionsKey = (o: MinimatchOptions): number | string => {
  for (const k in o) {
    switch (k) {
      // ... no 'case "__proto__":' branch ...
      default:
        n += (booleanWeights.get(k) ?? 0) * tri(v)

src/index.ts:291-296, copyOptions() copies with a plain assignment, not Object.defineProperty, so __proto__ runs through the real setter instead of landing as an own key:

const copyOptions = (o?: MinimatchOptions) => {
  const copy: Record<string, unknown> = {}
  for (const k in o) copy[k] = (o as Record<string, unknown>)[k]
  return copy as MinimatchOptions
}

cachedMinimatch() (src/index.ts:298-323) then stores the Minimatch built from the poisoned copyOptions(options) under the key optionsKey(options) returns — the same key a later, option-less call will look up. Neither function has the one missing check that matters here: special-case __proto__ before it reaches assignment.

Proof of concept
import { minimatch } from 'minimatch'

const smuggled = JSON.parse('{"__proto__":{"nocase":true}}')
// attacker's own call — nocase takes effect for them
const r1 = minimatch(file, patternLower, smuggled)
...

Then, with no knowledge of the call above, a second, fully-trusted caller matches the same pattern with zero options:

// SEPARATE caller, SAME pattern string, DEFAULT options
const r2 = minimatch(file, patternLower)
Result
minimatch("FOO-....TXT", "foo-....txt", smuggled) = true
minimatch("FOO-....TXT", "foo-....txt")  [no options]  = true  (expected false)
minimatch(<untouched UPPER>, <untouched lower pattern>) [no options] = false  (expected false)
cache-poisoned: true
global Object.prototype polluted: NO

r2 = true is the proof: a second, independent call with no options at all gets back the attacker's poisoned matcher. The untouched-pattern control stays false, and Object.prototype itself is never touched — this is cache poisoning, not classic global prototype pollution.

Impact

Any process that relies on the default, process-global minimatch() cache to evaluate security-relevant patterns (allow/deny lists, package-name filters) loses the integrity of that decision the moment one code path builds options from untrusted JSON — README.md's own stated default, "compared case sensitively, unless nocase:true is set," breaks for a bystander caller. This is not remote code execution and not data disclosure — it's a single boolean match-outcome flip, scoped to the shared cache, that persists until the entry is evicted.

Suggested Fix
// copyOptions(): never let __proto__ become the copy's own prototype
const copyOptions = (o?: MinimatchOptions) => {
  const copy = Object.create(null) as Record<string, unknown>
  for (const k in o) if (k !== '__proto__') copy[k] = (o as Record<string, unknown>)[k]
  return copy as MinimatchOptions
}

Severity

  • CVSS Score: 3.7 / 10 (Low)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Release Notes

isaacs/minimatch (minimatch)

v11.0.10

Compare Source

v11.0.9

Compare Source


Configuration

📅 Schedule: (in timezone Europe/Oslo)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added backport-ignore This PR is a new feature and should not be cherry-picked onto release branches kind/dependencies Pull requests that update a dependency file labels Dec 6, 2026
@coderabbitai

coderabbitai Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0a917057-ca71-420d-9484-30d51b015442

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-ignore This PR is a new feature and should not be cherry-picked onto release branches kind/dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants